{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import torch\n",
    "import mmengine"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# info_path = '../data/CODA/coda_track_results.pkl'\n",
    "# info_path = '../data/CODA/coda_infos_val.pkl'\n",
    "info_path = '../data/CODA/coda_infos_ros_test.pkl'\n",
    "info = mmengine.load(info_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "mmengine.dump(info, '../data/CODA/coda_infos_ros_test.pkl')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "info['data_list'] = info['data_list'][:75]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(3, dict_keys(['token', 'data_list']), '10_5815', 200)"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "len(info), info[0].keys(), info[0]['token'], len(info[0]['data_list'][0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'track_ids': [0],\n",
       " 'track_bboxes': [array([-109.50052607,  360.62135559,    4.52157606,    0.74414235,\n",
       "            0.71282548,    1.65397727,   -1.74968522,    0.61664706])],\n",
       " 'track_states': ['alive_1_0'],\n",
       " 'track_labels': [1],\n",
       " 'gt_bboxes': [array([-109.73163116,  361.45533251,    4.52523609,    0.99730501,\n",
       "            0.83391031,    1.76094715,   -1.54632966]),\n",
       "  array([-109.50542925,  360.59398011,    4.52043673,    0.99730501,\n",
       "            0.81961932,    1.76094715,   -1.54632966])],\n",
       " 'gt_labels': [1, 1],\n",
       " 'gt_ids': ['Pedestrian:4', 'Pedestrian:5']}"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "info[0]['data_list'][1][0]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python310",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
